package org.crazyit.cloud;

import feign.Feign;
import feign.gson.GsonDecoder;

/**
 * GsonDecoder解码器作用：json转成对象
 */
public class PersonMain {

    public static void main(String[] args) {
        HelloClient client = Feign.builder()
                .decoder(new GsonDecoder())
                //GsonDecoder 是解码器，我们返回的是json，json如何转成一个person对象。就需要GsonDecoder
                .target(HelloClient.class, "http://127.0.0.1:8080");
        Person person = client.getPerson(1);
        System.out.println(person);





    }
}
